//
//  MenuTableViewCell.m
//  Findif
//
//  Created by Mac on 2019/2/13.
//  Copyright © 2019年 Cicel Chen. All rights reserved.
//

#import "MenuTableViewCell.h"

@interface MenuTableViewCell ()

@property (nonatomic, weak) UIView * lineView;

@end

@implementation MenuTableViewCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    if ([super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self setupUI];
    }
    
    return self;
}

- (void)setupUI{
    
    self.selectionStyle = UITableViewCellSelectionStyleNone;
    self.backgroundColor = ZRWhiteColor;
    
    UILabel * showLabel = [UILabel new];
    
    showLabel.textColor = ZRBlackColor;
    showLabel.font = [UIFont systemFontOfSize:18 * SCREENH6];
    showLabel.textAlignment = NSTextAlignmentCenter;
    
    self.showLabel = showLabel;
    
    [self.contentView addSubview:self.showLabel];
    
    UIView * lineView = [UIView new];
    
    lineView.backgroundColor = ColorWithRGB(0xE4E4E4);
    
    self.lineView = lineView;
    
    [self.contentView addSubview:self.lineView];
}


- (void)layoutSubviews{
    
    [self.showLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(self.contentView);
        make.centerY.mas_equalTo(self.contentView);
    }];
    
    [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.mas_equalTo(self.contentView).offset(15 * SCREENH6);
        make.trailing.mas_equalTo(self.contentView).offset(-15 * SCREENH6);
        make.bottom.mas_equalTo(self.contentView);
        make.height.mas_equalTo(1 * SCREENH6);
    }];
}


- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
